/*
 * @Description: 包车订单详情数据模型
 * @Author: ziwei.ma
 * @Date: 2019-08-23 11:02:38
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-09-02 15:12:08
 */

export class OrderDetailModel {
  /**
   * @param {String} orderNo 订单编号
   * @param {String} outOrderNo 订单编号
   * @param {Number} state 订单状态
   * @param {String} payFee 实付金额
   * @param {Array} btnList 操作按钮数组
   * @param {String} storeName 商铺名称
   * @param {String} orderName 订单名称
   * @param {String} orderNum 订单数量
   * @param {String} orderImgUrl 订单图片
   * @param {String} payment 支付方式
   * @param {String} paymentName 支付方式
   * @param {String} createTime 创建时间
   */
  constructor(
    orderNo,
    outOrderNo,
    state,
    payFee,
    btnList,
    storeName,
    orderName,
    orderNum,
    orderImgUrl,
    payment,
    paymentName,
    paymentTime,
    createTime
  ) {
    this.orderNo = orderNo
    this.outOrderNo = outOrderNo
    this.state = state
    this.payFee = payFee
    this.btnList = btnList
    this.storeName = storeName
    this.orderName = orderName
    this.orderNum = orderNum
    this.orderImgUrl = orderImgUrl
    this.payment = payment
    this.paymentName = paymentName
    this.paymentTime = paymentTime
    this.createTime = createTime
    switch (state) {
      case -2:
        this.stateText = '交易关闭'
        break
      case -1:
        this.stateText = '待支付'
        break
      case 0:
        this.stateText = '已支付'
    }
  }
}
